﻿namespace _001_Iterator
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("-------------------Iterator-------------------");

            BookShelf bookShelf = new BookShelf(10);

            bookShelf.AppendBook(new Book("java"));
            bookShelf.AppendBook(new Book("python"));
            bookShelf.AppendBook(new Book("cpp"));
            bookShelf.AppendBook(new Book("rust"));
            bookShelf.AppendBook(new Book("haskell"));

            IIterator it = bookShelf.Iterator();

            while (it.HasNext())
            {
                var next = (Book)it.Next();
                Console.WriteLine(next.BookName);
            }


        }
    }
}
